/*
 * @Date: 2025-07-16 15:47:59
 * @Auth: 463997479@qq.com
 * @LastEditors: 463997479@qq.com
 * @LastEditTime: 2025-07-31 17:23:13
 * @FilePath: \corpus\src\pages\AuthKnowledge\EditAuthKnowledge\index.tsx
 */
import { Form, Input, Modal, Select } from 'antd';
import hook from '../hook';
import React from 'react';
import { StateEnum } from '@/enum';
/**
 *
 * @returns 审核页面功能
 */
const EditAuthKnowledge: React.FC = () => {
  const { visible, setVisible, form, applyReviewData } = hook.useContainer();
  const handleSubmit = () => {
    form.validateFields().then((vals) => {
      const method = applyReviewData;
      method.run({
        ...vals,
      });
    });
  };
  return (
    <Modal
      width={600}
      title="审核"
      open={visible}
      onCancel={() => {
        setVisible(false);
        form.resetFields();
      }}
      confirmLoading={applyReviewData.loading}
      onOk={handleSubmit}
    >
      <Form labelCol={{ span: 5 }} form={form}>
        <Form.Item name="id" hidden />

        <Form.Item label={'审核结果'} name="status" rules={[{ required: true }]}>
          <Select placeholder="请选择">
            <Select.Option value={StateEnum.REVIEW_APPROVE}>通过</Select.Option>
            <Select.Option value={StateEnum.REVIEW_REJECT}>不通过</Select.Option>
          </Select>
        </Form.Item>

        <Form.Item label={'备注'} name="remark" rules={[{ required: true }]}>
          <Input.TextArea placeholder="请输入" />
        </Form.Item>
      </Form>
    </Modal>
  );
};
export default EditAuthKnowledge;
